package edu.szu.huhanpeng.doodlingFight.view 
{
	import adobe.utils.CustomActions;
	import edu.szu.huhanpeng.doodlingFight.globalConst.GlobalConst;
	import edu.szu.huhanpeng.doodlingFight.view.components.MsgDlgBox;
	import flash.display.DisplayObjectContainer;
	import org.puremvc.as3.interfaces.IMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.interfaces.INotifier;
	import org.puremvc.as3.patterns.mediator.Mediator;
	
	/**
	 * ...
	 * @author Huhanpeng
	 */
	public class MsgDlgBoxMed extends Mediator implements IMediator, INotifier 
	{
		public static const NAME:String = "MsgDlgBoxMed";
		
		public function MsgDlgBoxMed() 
		{
			super( NAME, new MsgDlgBox() );
		}
		
		public function moveTo(x:int, y:int):void
		{
			dlgBox.x = x;
			dlgBox.y = y;
		}
		
		public function moveToCenter(width:int, height:int):void 
		{
			dlgBox.x = (width - dlgBox.width) / 2;
			dlgBox.y = (height - dlgBox.height) / 2;			
			//dlgBox.x =0;
			//dlgBox.y = 0;			
			//dlgBox.x =(parent.width ) / 2;
			//dlgBox.y =(parent.height) / 2;	
		}
		
		
		public function setMsg(str:String):void
		{
			dlgBox.setMsg( str );
		}
		
		public function setCallBack(func:Function):void 
		{
			dlgBox.setCallBack( func );
		}
		
		public function setFuncArgs(arr:Array):void 
		{
			dlgBox.setFuncArgs( arr );
		}
		

		
		protected function get dlgBox():MsgDlgBox
		{
			return viewComponent as MsgDlgBox;
		}
		
	}

}